Prevent a segfault if GtkAppChooserDialog gets disposed early
authorMatthias Clasen <mclasen@redhat.com>
Fri, 3 May 2013 00:00:49 +0000 (20:00 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 3 May 2013 00:00:49 +0000 (20:00 -0400)
If the async call is finished after the dialog is already disposed,
bad things happen. Prevent that by marking the dialog as dismissed
in this case.

gtk/gtkappchooserdialog.c

index e55eac33e7404db2ddc569853d8534837a97c66b..ce7cfeed578e96cb86ba3cf10f66c2358c61b79f 100644 (file)
@@ -536,6 +536,8 @@ gtk_app_chooser_dialog_dispose (GObject *object)
   cancel_and_clear_cancellable (self);
   g_clear_object (&self->priv->online);
 
+  self->priv->dismissed = TRUE;
+
   G_OBJECT_CLASS (gtk_app_chooser_dialog_parent_class)->dispose (object);
 }